import Vue from 'vue'
import Router from 'vue-router'
import Logins from '../view/Logins.vue'
import home from '@/components/home'
import nav1 from '../view/nav1.vue'
import nav2 from '../view/nav2.vue'
// import orderList from '../view/orderList.vue'


import dashboard from '../view/dashboard.vue'
const shop        = () => import('@/view/shop.vue')
const userList    = () => import('@/view/userList.vue')
const addShop     = () => import('@/view/addShop.vue')
const explain     = () => import('@/view/explain.vue')
const food        = () => import('@/view/food.vue')
const orderList   = () => import('@/view/orderList.vue');
const adminList   = () => import('@/view/adminList.vue');
const echarts     = () => import('@/view/echarts.vue');
const compontProp = () => import('@/view/compontProp.vue');
const videos      = () => import('@/view/videos.vue');
const tree      = () => import('@/view/tree.vue');
const parent      = () => import('@/view/parent.vue');
const numData      = () => import('@/view/numData.vue');
const compareText      = () => import('@/view/compareText.vue');
const map      = () => import('@/view/map.vue');
const signature      = () => import('@/view/signature.vue');
const UserConfigDetail      = () => import('@/view/UserConfigDetail.vue');
const message      = () => import('@/components/message.vue');









// const userList = r => require.ensure([], () => r(require('@/page/userList')), 'userList');


Vue.use(Router)
export default new Router({
    base: '/form/',
    mode: 'history', //没有#号  
    routes: [{
            path: '/Logins',
            name: 'Logins',
            component: Logins
        },
        {
            path: '*',
            component: () => import('@/components/404')
        }, {
            path: '/',
            redirect: '/Logins',
            name: 'home',
            component: home,
            children: [{
                    path: 'nav1',
                    name: '首页',
                    component: nav1,
                    // children: [
                    //     {path: 'dashboard', name: '首页1', component: dashboard,},
                    //     {path: 'dashboard2', name: '首页2', component: dashboard,
                    //   children: [
                    //     {path: 'dashboard21', name: '首页21', component: dashboard,},
                    //     {path: 'dashboard22', name: '首页22', component: dashboard, },
                    //   ] 
                    //     },
                    //   ]
                },
                {
                    path: '/shop',
                    name: 'shop',
                    component: shop
                },
                {
                    path: '/userList',
                    name: 'userList',
                    component: userList
                },
                {
                    path: 'nav2',
                    name: '文章',
                    component: nav2,
                },
                {
                    path: '/addShop',
                    component: addShop,
                    meta: ['添加数据', '添加商铺'],
                },  {
                    path: '/compontProp',
                    name: 'compontProp',
                    component: compontProp,
                },
                {
                    path:'/videos',
                    name:'videos',
                    component:videos,
                },
                {
                    path:'/tree',
                    name:'tree',
                    component:tree,
                },
                {
                    path: '/explain',
                    name: 'explain',
                    component: explain,
                },
                {
                    path: '/food',
                    name: 'food',
                    component: food,
                },
                {
                    path: '/orderList',
                    name: 'orderList',
                    component:orderList,
                }, {
                    path: '/adminList',
                    name: 'adminList',
                    component:adminList,
                }, {
                    path: '/echarts',
                    name: 'echarts',
                    component:echarts,
                },
                {
                    path: '/compareText',
                    name: 'compareText',
                    component:compareText,
                },
                {
                    path: '/message',
                    name: 'message',
                    component:message,
                },
                {
                    path: '/UserConfigDetail',
                    name: 'UserConfigDetail',
                    component:UserConfigDetail,
                },
                {
                    path: '/signature',
                    name: 'signature',
                    component:signature,
                },
                {
                    path: '/parent',
                    name: 'parent',
                    component:parent,
                },
                {
                    path: '/numData',
                    name: 'numData',
                    component:numData,
                },
                {
                    path: '/map',
                    name: 'map',
                    component:map,
                },
                
               
            ]
        },
    ]
})